Initial commit, add base structure, vue frontend + backend#1
Open
maxtaube wants to merge 21 commits into
Open
Conversation
Add forced-provider support for cloud environment
Support JSON completion requests across providers, expose decoded JSON responses, prevent duplicate provider registrations, and hide AI provider settings in managed environments.
Add AIProvider exception hierarchy, properly implemented test connection function, fixed custom provider model implementation, dropped rawReponse key from the AIProviderResponse
Add converse() methods for plugins that need conversations with tool calling. Added canonical message shapes
mneudert
reviewed
Jun 22, 2026
…t, add fail reason handling
…e DI instead of StaticContainer in some places, fix ellipsis
…bump plugin version, update README.md, rebuild files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds the AIProviders plugin, which gives Matomo a shared server-side integration layer for AI features. It supports
Anthropic,OpenAI,Google, and OpenAI-compatiblecustom endpoints, with an admin UI for self-managed instances to configure credentials, default provider, model settings, and connection tests.Other plugins should not call completion endpoints through
API.php; those methods are only for the administration UI. Runtime use goes throughAIProviderService:complete(new AIRequest($prompt, $callerPlugin))for prompt-in/text-out or JSON responses.converse(new AIConversationRequest($messages, $callerPlugin))for multi-turn conversations and tool-calling flows.Requests use immutable request objects for:
Conversation messages use a provider-agnostic canonical shape, and each provider translates that shape to its own wire format. Responses expose text/content, provider/model metadata, token usage where available, stop reason, and timing.
Self-managed instances can configure providers in the UI or via server-side configuration. In a managed environment, provider configuration is locked server-side, the admin screen is hidden, and normal plugin requests are routed through the managed default provider. Provider/model selection is only honored for selected trusted server-side callers.
A custom provider can either be configured through the built-in Custom Provider option in the UI, using an OpenAI-compatible base URL plus an optional API key, or registered by another plugin via the
AIProviders.addAIProvidersevent with a customAIProviderclass.Includes unit and integration coverage for configuration resolution, managed-environment behavior, provider registration, completion requests, JSON responses, conversation support, and provider-specific request/response translation.
Review